package com.example.myapplication.xiaochengxu;

import com.example.myapplication.shortvideo.utils.GsonUtil;
import com.example.myapplication.util.MD5Utils;

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author: rongfeng
 * @date: 2020/12/1
 * @description
 */
public class UpdateNname {


    public static void main(String[] args) {
        String path = "D:\\wrf\\zhumian\\mp3";
        String imgs = "D:\\wrf\\zhumian\\img";
        File file = new File(path);
        File[] list = file.listFiles();

        File outFile = new File(path);

        if (!outFile.isDirectory()) {
            outFile.mkdir();
        }

        List<caier.Bean.TrackList> lists = new ArrayList<>();
        // 如果目录下文件存在
        if (file.exists() && file.isDirectory()) {
            for (int i = 0; i < list.length; i++) {

                //取文件名子存入name中
                String name = list[i].getName();
                System.out.println(i);

                caier.Bean.TrackList bean1 = new caier.Bean.TrackList();
                bean1.customTitle = "asmr_"+(i+1);
                bean1.duration = 0;
                bean1.tabIds = new int[]{14};
                bean1.trackId = Integer.parseInt(name.replace(".m4a",""));
                lists.add(bean1);
            }
        }


        String json = GsonUtil.toJson(lists);
        System.out.println(json);
    }


    static class Bean implements Serializable {
        public String videoName;
    }


}
